// components/hdItem/hdItem.js
const app = getApp();
Component({
  /**
   * 组件的属性列表
   */
  properties: {
    item: {
      type: Object,
    },
  },

  /**
   * 组件的初始数据
   */
  data: {},

  /**
   * 组件的方法列表
   */
  methods: {
    toControllerPage(e) {
      const splid = e.currentTarget.dataset.splid;
      wx.navigateTo({
        url: '/pages/index/controller/controller?liveid=' + splid,
      });
    },
    toCommentPage(e) {
      const splid = e.currentTarget.dataset.splid;
      wx.navigateTo({
        url: `/pages/index/comment/comment?splid=${splid}`,
      });
    },
    toIncomePage(e) {
      const {
        splid,
        type
      } = e.currentTarget.dataset;
      wx.navigateTo({
        url: `/pages/index/scene/scene?splid=${splid}&type=${type}`,
      });
    },
    toGiftAllFree(e) {
      const {
        splid
      } = e.currentTarget.dataset;
      wx.navigateTo({
        url: `/pages/index/giftAllFree/giftAllFree?splid=${splid}`,
      });
    },
    // openGuessHbQrcode(e) {
    //   this.triggerEvent('open', e.currentTarget.dataset);
    // },
    toNewlyWedsFeedBack(e) {
      const {
        id,
        userId
      } = this.data.item
      wx.navigateToMiniProgram({
        appId: 'wx6d95d8e3ffefac1d',
        path: `pages/compere/compere?splid=${id }`,
        extraData: {
          splid: id,
          userId,
          feedback:true,
        },
        envVersion: "release", // 打开正式版
        success(res) {
          // 打开成功
        },
        fail: function (err) {
          ;
        }
      })
    }
  },
});